package Reflect;

import Reflect.annotation.AutoRunClass;

import java.lang.reflect.Method;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入类名");
        Class cla=Class.forName(sc.next());
        boolean mark=cla.isAnnotationPresent(AutoRunClass.class);
        if (mark){
            System.out.println("有注解");
            Object obj=cla.newInstance();
            System.out.println(obj);
        }else {
            System.out.println("没有注解");
        }
    }
}
